/**
 * 经典继承又叫借用构造函数继承 
 */
// 提供父构造函数 
function Parent(name, age, gender) {
    // new关键字 this---->Parent实例 
    this.name = name;
    this.age = age;
    this.gender = gender;
    this.sayAge = function () {
        console.log(this.age)
    }
}
// 提供子构造函数 
function Child(name, age, gender, weight) {
    // Parent();//this---->Parent实例 为了指向子构造函数实例 修改this指向
    // 经典继承 借用构造函数继承 
    Parent.call(this, name, age, gender);
    this.weight = weight;
    // this.name = name;//this---->Child实例
    // this.age = age;
    // this.gender = gender;
}
var c1 = new Child('terry', 18, 'male', '40kg');
console.log(c1);
c1.sayAge();
